#include <stdio.h>
#include <stdlib.h>
#include "../lib/selection_sort.h"

string selection_sort (string inputs)
{
    unsigned long int n = strlen (inputs);

    int 
      minimo = 0
    , i
    , j
    ;
    
    char swap;

    for(i = 0 ; i < n-1 ; i++)
    {
        minimo = i;
        for( j = i + 1; j < n; j++)
            if (inputs[minimo] > inputs[j])
                minimo = j;

        swap = inputs [minimo];
        inputs [minimo] = inputs [i];
        inputs[i] = swap;
    }
    
    return inputs;

} // selection_sort
